package com.JVM;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * Hello world!
 *
 */
public class App 
{
    static {
        System.setProperty("test","testvalue");
    }
    private static final int _1MB = 1024*1024;
    private static final int _1KB = 1024;
    private static final int num = 1000;

    public static void main( String[] args )
    {
//        byte[] allo1,allo2,allo3,allo4;
//        allo1 = new byte[2*_1MB];
//        allo2 = new byte[2*_1MB];
//        allo3 = new byte[2*_1MB];
//        allo4 = new byte[4*_1MB];
//        System.out.println("end");
//        while (true){
//
//        }
        List list = new ArrayList();
        for(int i=0;i<num;i++){
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            list.add(new byte[10*_1MB]);
        }
        System.gc();
    }
}
